import { isCodeMessage } from "@/api/config"
import { Teamate } from "@/type/teamate"

/**
 * @author: 小佘佘🦀
 * @description: 修改用户名称
 * @param {Teamate} teamate
 * */
export const updateUserName = async (teamate: Teamate) => {

    const response = await fetch(`/api-backend/api/team/upname`, {
        method: "POST",
        headers: {
            "content-type": "application/json;charset=utf-8",
        },
        body: JSON.stringify(teamate),
        redirect: "manual"
    })

    return isCodeMessage(response)
}